home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Palettes.p < prev    next >
Encoding:
Text File  |  1989-10-13  |  3.8 KB  |  130 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Saturday, September 16, 1989 at 4:19 PM
  3.     Palettes.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.    1987-1989
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Palettes;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingPalettes}
  21. {$SETC UsingPalettes := 1}
  22.  
  23. {$I+}
  24. {$SETC PalettesIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingWindows}
  30. {$I $$Shell(PInterfaces)Windows.p}
  31. {$ENDC}
  32. {$SETC UsingIncludes := PalettesIncludes}
  33.  
  34. CONST
  35. pmCourteous = 0;                            {Record use of color on each device touched.}
  36. pmTolerant = 2;                             {render ciRGB if ciTolerance is exceeded by best match.}
  37. pmAnimated = 4;                             {reserve an index on each device touched and render ciRGB.}
  38. pmExplicit = 8;                             {no reserve, no render, no record; stuff index into port.}
  39. pmInhibitG2 = 256;
  40. pmInhibitC2 = 512;
  41. pmInhibitG4 = 1024;
  42. pmInhibitC4 = 2048;
  43. pmInhibitG8 = 4096;
  44. pmInhibitC8 = 8192;
  45.  
  46. { NSetPalette Update Constants }
  47.  
  48. pmNoUpdates = $8000;                        {no updates}
  49. pmBkUpdates = $A000;                        {background updates only}
  50. pmFgUpdates = $C000;                        {foreground updates only}
  51. pmAllUpdates = $E000;                        {all updates}
  52.  
  53.  
  54. TYPE
  55.  
  56. ColorInfo = RECORD
  57.     ciRGB: RGBColor;                        {true RGB values}
  58.     ciUsage: INTEGER;                        {color usage}
  59.     ciTolerance: INTEGER;                    {tolerance value}
  60.     ciDataFields: ARRAY [0..2] OF INTEGER;    {private fields}
  61.     END;
  62.  
  63. PalettePtr = ^Palette;
  64. PaletteHandle = ^PalettePtr;
  65. Palette = RECORD
  66.     pmEntries: INTEGER;                     {entries in pmTable}
  67.     pmDataFields: ARRAY [0..6] OF INTEGER;    {private fields}
  68.     pmInfo: ARRAY [0..0] OF ColorInfo;
  69.     END;
  70.  
  71.  
  72.  
  73. PROCEDURE InitPalettes;
  74.     INLINE $AA90;
  75. FUNCTION NewPalette(entries: INTEGER;srcColors: CTabHandle;srcUsage: INTEGER;
  76.     srcTolerance: INTEGER): PaletteHandle;
  77.     INLINE $AA91;
  78. FUNCTION GetNewPalette(PaletteID: INTEGER): PaletteHandle;
  79.     INLINE $AA92;
  80. PROCEDURE DisposePalette(srcPalette: PaletteHandle);
  81.     INLINE $AA93;
  82. PROCEDURE ActivatePalette(srcWindow: WindowPtr);
  83.     INLINE $AA94;
  84. PROCEDURE SetPalette(dstWindow: WindowPtr;srcPalette: PaletteHandle;cUpdates: BOOLEAN);
  85.     INLINE $AA95;
  86. PROCEDURE NSetPalette(dstWindow: WindowPtr;srcPalette: PaletteHandle;nCUpdates: INTEGER);
  87.     INLINE $AA95;
  88. FUNCTION GetPalette(srcWindow: WindowPtr): PaletteHandle;
  89.     INLINE $AA96;
  90. PROCEDURE CopyPalette(srcPalette: PaletteHandle;dstPalette: PaletteHandle;
  91.     srcEntry: INTEGER;dstEntry: INTEGER;dstLength: INTEGER);
  92.     INLINE $AAA1;
  93. PROCEDURE PmForeColor(dstEntry: INTEGER);
  94.     INLINE $AA97;
  95. PROCEDURE PmBackColor(dstEntry: INTEGER);
  96.     INLINE $AA98;
  97. PROCEDURE AnimateEntry(dstWindow: WindowPtr;dstEntry: INTEGER;srcRGB: RGBColor);
  98.     INLINE $AA99;
  99. PROCEDURE AnimatePalette(dstWindow: WindowPtr;srcCTab: CTabHandle;srcIndex: INTEGER;
  100.     dstEntry: INTEGER;dstLength: INTEGER);
  101.     INLINE $AA9A;
  102. PROCEDURE GetEntryColor(srcPalette: PaletteHandle;srcEntry: INTEGER;VAR dstRGB: RGBColor);
  103.     INLINE $AA9B;
  104. PROCEDURE SetEntryColor(dstPalette: PaletteHandle;dstEntry: INTEGER;srcRGB: RGBColor);
  105.     INLINE $AA9C;
  106. PROCEDURE GetEntryUsage(srcPalette: PaletteHandle;srcEntry: INTEGER;VAR dstUsage: INTEGER;
  107.     VAR dstTolerance: INTEGER);
  108.     INLINE $AA9D;
  109. PROCEDURE SetEntryUsage(dstPalette: PaletteHandle;dstEntry: INTEGER;srcUsage: INTEGER;
  110.     srcTolerance: INTEGER);
  111.     INLINE $AA9E;
  112. PROCEDURE CTab2Palette(srcCTab: CTabHandle;dstPalette: PaletteHandle;srcUsage: INTEGER;
  113.     srcTolerance: INTEGER);
  114.     INLINE $AA9F;
  115. PROCEDURE Palette2CTab(srcPalette: PaletteHandle;dstCTab: CTabHandle);
  116.     INLINE $AAA0;
  117. FUNCTION Entry2Index(srcEntry: INTEGER): LONGINT;
  118.     INLINE $7000,$AAA2;
  119. PROCEDURE RestoreDeviceClut(gdh: GDHandle);
  120.     INLINE $7002,$AAA2;
  121. PROCEDURE ResizePalette(srcPalette: PaletteHandle;dstSize: INTEGER);
  122.     INLINE $7003,$AAA2;
  123.  
  124. {$ENDC}    { UsingPalettes }
  125.  
  126. {$IFC NOT UsingIncludes}
  127.     END.
  128. {$ENDC}
  129.  
  130.